package Events;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextArea;

import structures.Spaceship;


/**
 * End game event. You win!
 * @author edd
 *
 */
@SuppressWarnings("serial")
public class EndGameEvent extends PathEvent {

	/**
	 * Constructor
	 * @param name	name of event
	 * @param description	description of event
	 * @param location	location of event
	 */
	public EndGameEvent(String name, String description, int location) {
		super(name, description, location);
		this.setLayout(null);
		JLabel congrats = new JLabel("Congrats you won! You made it to Planet Eden! (Name subject to changes)");
		congrats.setBounds(75, 150, 500, 40);
		this.add(congrats);
		JButton quit = new JButton("Quit");
		quit.addActionListener(new QuitListener());
		quit.setBounds(300, 190, 60, 30);
		this.add(quit);
	}

	@Override
	public boolean isRunning() {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public void nextPhase() {
		// TODO Auto-generated method stub

	}

	@Override
	public void prevPhase() {
		// TODO Auto-generated method stub

	}

	@Override
	public void execute(Spaceship s) {
		// TODO Auto-generated method stub

	}
	
	public void execute(Spaceship s, JTextArea log) {
	    this.execute(s);
	}
	
	private class QuitListener implements ActionListener
	{

		@Override
		public void actionPerformed(ActionEvent e) {
			System.exit(0);
		}
	
	}

}
